﻿''' <summary>
''' 建筑物和错落层楼个数
''' </summary>
''' <remarks></remarks>
<Serializable()> Public Class Bldgi
    Implements ICloneable

    Private m_BuildStack As String = "Bldg" '建筑物的序号
    Private m_BuildName As String = "建筑物" '建筑物名称
    Private m_BuildHight As Double = 0 '建筑物的基地海拔高度
    Private m_ArryBuildTire(0) As CAermod.BuildTire '包含建筑物顶部角的个数和建筑物的高度。建筑物顶部角的数据为整数，建筑物的高度为实数

    ''' <summary>
    ''' 建筑物序号
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property BuildStack() As String
        Get
            Return m_BuildStack
        End Get
        Set(ByVal value As String)
            m_BuildStack = value
        End Set
    End Property
    ''' <summary>
    ''' 建筑物的名称
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property BuildName() As String
        Get
            Return Me.m_BuildName
        End Get
        Set(ByVal value As String)
            Me.m_BuildName = value
        End Set
    End Property
    ''' <summary>
    ''' 错落层楼个数
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    ReadOnly Property BuildCount() As Integer
        Get
            Return m_ArryBuildTire.Length
        End Get
    End Property
    ''' <summary>
    ''' 建筑物的基地海拔高度
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property BuildHight() As Double
        Get
            Return m_BuildHight
        End Get
        Set(ByVal value As Double)
            m_BuildHight = value
        End Set
    End Property
    ''' <summary>
    ''' 包含建筑物顶部角的个数和建筑物的高度。建筑物顶部角的数据为整数，建筑物的高度为实数
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property ArryBuildTire() As CAermod.BuildTire()
        Get
            Return m_ArryBuildTire
        End Get
        Set(ByVal value As CAermod.BuildTire())
            m_ArryBuildTire = value
        End Set
    End Property
    ''' <summary>
    ''' 初始化建筑物为1层
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub New()
        m_ArryBuildTire(0) = New BuildTire
    End Sub
    ''' <summary>
    ''' 返回建筑物和错落层楼个数，字符串
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function OutBldgi() As String
        Dim StrBldgi As String = ""
        StrBldgi += "'" & Me.BuildStack & "' " & Me.BuildCount & " " & Me.BuildHight & vbCrLf
        For i As Integer = 0 To Me.ArryBuildTire.Length - 1
            StrBldgi += Me.ArryBuildTire(i).OutBuildTire()
        Next
        Return StrBldgi
    End Function

    Public Function Clone() As Object Implements System.ICloneable.Clone
        Dim obj As New Bldgi
        obj.m_BuildStack = Me.m_BuildStack  '建筑物序号
        obj.m_BuildName = Me.m_BuildName '建筑物名称
        obj.m_BuildHight = Me.m_BuildHight  '建筑物的基地海拔高度
        ReDim obj.m_ArryBuildTire(Me.m_ArryBuildTire.Length - 1)
        For i As Integer = 0 To Me.m_ArryBuildTire.Length - 1
            obj.m_ArryBuildTire(i) = Me.m_ArryBuildTire(i).Clone
        Next
        Return obj
    End Function
End Class
